package com.vincent.sciinfo.mapper;


import com.vincent.sciinfo.pojo.Patent;
import com.vincent.sciinfo.pojo.PatentExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface PatentMapper {
    long countByExample(PatentExample example);

    int deleteByExample(PatentExample example);

    int deleteByPrimaryKey(String resultuuid);

    int insert(Patent record);

    int insertSelective(Patent record);

    List<Patent> selectByExample(PatentExample example);

    Patent selectByPrimaryKey(String resultuuid);

    int updateByExampleSelective(@Param("record") Patent record, @Param("example") PatentExample example);

    int updateByExample(@Param("record") Patent record, @Param("example") PatentExample example);

    int updateByPrimaryKeySelective(Patent record);

    int updateByPrimaryKey(Patent record);

    @Update("update paper set score = (select score from scorestandard where name = #{patentType} ) where resultUUid = #{resultUUid}")
    int updatePatentScoreByType(@Param("resultUUid") String resultuuid, @Param("patentType") String patentType);

    @Update("update patent set score = #{score} where resultUUid = #{patentId}")
    int scorePatent(@Param("patentId") String patentId, @Param("score") int score);
}